<!DOCTYPE html>
<html lang="en">
<head>
    <title>按银行账户统计</title>
    <#include "../inc/header.ftl"/>
</head>

<body class="no-skin">

<div class="main-container ace-save-state" id="main-container">

    <div class="main-content">
        <div class="main-content-inner">

            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <table id="MainGrid"></table>
                        <div id="toolbar">
                            <div style="padding:8px">
                                收款账户：<input id="accountcode" name="accountcode" >&emsp;
                                收款日期：<input id="paybankdt" name="paybankdt" class="easyui-datebox" editable="false" style="width:140px">
                                <a href="#" onclick="javascript:searchInfo()" class="easyui-linkbutton" iconCls="icon-search">查 询</a>

                            </div>
                        </div>
                    </div>
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
</div><!-- /.main-container -->

<!-- basic scripts -->
<#include "../inc/basicjs.ftl"/>

<!-- inline scripts related to this page -->
<script type="text/javascript">
    jQuery(function($) {
        var curr_time = new Date();
        var str = curr_time.getFullYear()+"-";
        str += curr_time.getMonth()+1+"-";
        str += curr_time.getDate()+"-";
        $('#paybankdt').datebox('setValue',str);

    });

    function listPage(url,mark) {
        if (mark == 1) {
            var bankid = $('#bankid').val();
            var paybankdt = $('#paybankdt').val();
            if(bankid==null||bankid==''){
                $.messager.alert('提示', '请选择账户!', 'info');
                return;
            }
        }
        // 右侧表格
        $('#MainGrid').datagrid({
            url: url,
            checkbox: true,
            pagination: true,
            fitColumns:false,
            striped: true,
            singleSelect: true,
            loadMsg: "正在加载数据，请稍后...",
            queryParams: {bankid:bankid,paybankdt:paybankdt},
            columns:[[
                { title: '银行账户',field: 'accountcode',width:150},
                { title: '开户行名称',field: 'bankname',  width: 200},
                { title: '日期',field: 'paybankdt',width:150},
                { title: '笔数',field: 'num',width:100},
                { title: '金额',field: 'amt',width: 100 }
            ]],
            toolbar: '#toolbar'
        });

        $(window).resize(function() {
            $('#MainGrid').datagrid('resize');
        });
    }

    function searchInfo() {
       listPage(prefix + '/query/queryBank',1);
    }
    $('#accountcode').combogrid({
        panelWidth:550,
        idField:'accountcode',
        textField:'accountcode',
        url:prefix+'/base/basedata/findBank',
        columns:[[
            {field: 'ck', checkbox: true},
            {field:'cantonname',title:'区划',width:80},
            {field:'accountcode',title:'账号',width:160},
            {field:'bankname',title:'开户行名称',width:260}
        ]]
    });
</script>
</body>
</html>
